home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
jungle_adventure.swf
/
scripts
/
__Packages
/
SSZone.as
< prev
next >
Wrap
Text File
|
2006-11-29
|
1KB
|
55 lines
class SSZone extends SSObject
{
static var SPHERE = 0;
static var RECT = 1;
var assetID = null;
var boundType = SSZone.SPHERE;
var classID = SSGlobal.CLSID_ZONE;
var editor_canChangeAsset = false;
var editor_canChangeLayer = false;
var editor_canChangeFrame = false;
function SSZone(type, size, onCollision, ownerObject)
{
super();
if(arguments.length)
{
this.init.apply(this,arguments);
}
}
function init(type, size, onCollision, ownerObject)
{
if(this.boundType = type)
{
if(size)
{
this.localTop = this.localLeft = 0;
this.localRight = size.x;
this.localBottom = size.y;
}
else
{
this.localTop = this.localLeft = 0;
this.localRight = this.localBottom = 100;
}
}
else
{
if(size)
{
this.radius = size;
}
this.localTop = this.localLeft = - (this.localRight = this.localBottom = this.radius);
}
if(onCollision)
{
this.onColMethod = onCollision;
}
this.owner = ownerObject;
this.args = arguments.slice(4);
}
function onCollision(obj)
{
return this.onColMethod.call(this.owner,obj);
}
}